<%--
  Created by IntelliJ IDEA.
  User: dell5480
  Date: 2021/7/6
  Time: 8:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <!--引入layui样式文件-->
    <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>
<div class="layui-form-item">
    <label class="layui-form-label">楼层号</label>
    <div class="layui-input-block">
        <input type="text" id="floorNum"   class="layui-input"
               style="width: 200px;">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">楼层房间数</label>
    <div class="layui-input-block">
        <input type="text" id="count"   class="layui-input"
               style="width: 200px;">
    </div>
</div>
<button class="layui-btn layui-btn-normal"
        style="margin-left: 200px;" onclick="save()">保存</button>
</body>
<script src="layui/layui.js"></script>
<script>
    var $;
    layui.use(['jquery'],function(){
        $ = layui.jquery;

    });

    function save(){
        if($("#floorNum").val()==''||$("#floorNum").val()==null){
            alert("楼层名不能为空");
            return;
        }
        if($("#count").val()==''||$("#count").val()==null){
            alert("楼层房间数不能为空");
            return;
        }
        var index = parent.layer.getFrameIndex(window.name);
        window.parent.addDept($("#floorNum").val(),$("#count").val());
        parent.layer.close(index);
    }
</script>
</html>
